<div class="r0 p20 pt10 col-xs-12" ng-controller="sourceCtrl">
<div class="col-xs-6 f16 fb p0 mb5">资源管理</div>
<div class="col-xs-6 f14 p0 mb5 tr">
	<a type="button" class="btn btn-default btn-sm">目录：【{{$stateParams.directoryName}}】</a>
	<a type="button" class="btn btn-primary btn-sm" id="refresh" ng-click="getData(list.page.currentPage)"> <i class="iconfont fb">&#xe611;&nbsp;</i>刷新</a>
	<a type="button" class="btn btn-purple btn-sm" onclick="history.back(-1);"> <i class="iconfont fb">&#xe605;&nbsp;</i>后退</a>
</div>
<div class="col-xs-12 bb1 bt1 pt15 p0 pb10">
		<button type="button" class="ml5 mt1 btn btn-success btn-sm fr" ng-click="getData(1);">
			<i class="iconfont">&#xe60d;</i>&nbsp;查询
		</button>
		<div class="form-group w200 fr">
			<label class="sr-only" for="">名称</label>
			<div class="input-group">
				<div class="input-group-addon">名称</div>
				<input type="text" class="form-control input-xs dis-in-blo w120"
					placeholder="名称" ng-model="$stateParams.name">
			</div>
		</div>
		<div class="cb"></div>
</div>
<div class="col-xs-12 mt20 p0 mb10 f14 tr">
	<a type="button" class="btn btn-success btn-sm cursor" ng-if="showOperation('SOURCE')"
		ng-click="detail('新增目录',800,'module/detail.do?id=NULL&type=DIRECTORY','&parentId='+$stateParams.directoryId)"> 
		<i class="iconfont fb">&#xe604;</i>&nbsp;新增目录
	</a>
	<a type="button" class="btn btn-success btn-sm cursor" ng-if="showOperation('SOURCE')"
		ng-click="detail('新增文件',800,'back/source/detail.do?id=NULL','&directoryId='+$stateParams.directoryId)"> 
		<i class="iconfont fb">&#xe604;</i>&nbsp;新增文件
	</a>
</div>

<div class="col-xs-3 f16 fb pl0 mb10 pb5 mt20" ng-if="list.directorys.length>0">
	<!-- 一级模块显示为项目，其他均为模块 -->
	<span>目录列表</span>
</div>
<div class="col-xs-12 p0" ng-if="list.directorys.length>0">
	<table class="table table-bordered table-hover">
		<thead>
			<tr class="BGEEE">
				<th class="tc">名称</th>
				<th class="tc">简介</th>
				<td class="tc">排序</td>
				<th class="w300 tc">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr ng-repeat="item in list.directorys">
				<td class="tc">{{item.name}}</td>
				<td class="tc">{{item.remark}}</td>
				<td class="tc">{{item.sequence}}</td>
				<td class="tc w300">
				<a class="f12 text-primary mr10 cursor" ng-if="showOperation('SOURCE')"
					ng-click="detail('编辑【'+item.name+'】',700,'module/detail.do?id='+item.id)"
					data-toggle="tooltip" data-placement="top"
					data-original-title="编辑"> <i class="iconfont f12">&#xe618;修改</i>
				</a>
				<a class="f12 text-primary mr10 cursor" ng-href="#/back/source/list/{{item.id}}/{{item.name}}"> 
					<i class="iconfont f12">&#xe60f;查看文档</i>
				</a>
				<a class="f12 text-danger mr10 cursor" title="删除" ng-if="showOperation('SOURCE')" ng-click="del('module/delete.do?id='+item.id,item.name)">
					<i class="iconfont f12">&#xe60e;删除</i>
				</a>
				<div class="w50 fr tl">
					<a class="f12 text-danger mr10 cursor" title="向上移" ng-click="changeSequence('module',item.id,list.directorys[$index-1].id)" ng-if="$index>0">
						<i class="iconfont f12">&#xe623;</i>
					</a>
					<a class="f12 text-danger mr10 cursor" title="向下移" ng-click="changeSequence('module',item.id,list.directorys[$index+1].id)" ng-if="$index<list.directorys.length-1">
						<i class="iconfont f12">&#xe624;</i>
					</a>
				</div>
				</td>
			</tr>
		</tbody>
	</table>
</div>
<div class="col-xs-3 f16 fb pl0 mb10 pb5 mt20" ng-if="list.sources.length>0">文档列表</div>
<div class="col-xs-12 p0" ng-if="list.sources.length>0">
	<table class="table table-bordered table-hover">
		<thead>
			<tr class="BGEEE">
				<th class="tc">名称</th>
				<th class="tc">摘要</th>
				<th class="tc">排序</th>
				<th class="tc">最后修改时间</th>
				<th class="w300 tc">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr ng-repeat="item in list.sources">
				<td class="tc w200">{{item.name}}</td>
				<td class="tc">{{item.remark|cut:true:50:' ...'}}</td>
				<td class="tc">{{item.sequence}}</td>
				<td class="tc">{{getDate(item.updateTime)|date:'yyyy-MM-dd HH:mm'}}</td>
				<td class="tc">
				<a class="f12 text-primary mr10 cursor" ng-if="showOperation('SOURCE')"
				ng-click="detail('编辑【'+item.name+'】',800,'back/source/detail.do?id='+item.id,'&directoryId='+$stateParams.directoryId)"> 
					<i class="iconfont f12">&#xe618;修改</i>
				</a>
				<a class="f12 text-danger mr10 cursor" title="删除"  ng-if="showOperation('SOURCE')"
					ng-click="del('back/source/delete.do?id='+item.id,item.name)">
					<i class="iconfont f12">&#xe60e;删除</i>
				</a>
				<a class="f12 text-primary mr10 cursor" ng-href="index.do#/front/source/detail/{{item.id}}" target="_blank"> 
					<i class="iconfont f12">&#xe60a;预览</i>
				</a>
				<div class="w50 fr tl">
					<a class="f12 text-danger mr10 cursor" title="向上移" ng-click="changeSequence('source',item.id,list.sources[$index-1].id)" ng-if="$index>0">
						<i class="iconfont f12">&#xe623;</i>
					</a>
					<a class="f12 text-danger mr10 cursor" title="向下移" ng-click="changeSequence('source',item.id,list.sources[$index+1].id)" ng-if="$index<list.sources.length-1">
						<i class="iconfont f12">&#xe624;</i>
					</a>
				</div>
				</td>
			</tr>

		</tbody>
	</table>
	<div ui-view="page"></div>
</div>
</div>
<div class="cb"></div>

